import http from '@/utils/http2.js'

export function login(data) {
  return http.post('/auction-user/api/login', data)
}

export function register(data) {
  return http.post('/auction-user/api/saveUser', data)
}

export function getCaptcha() {
  return http.get('/auction-user/api/generateValidateCode')
}

export function getMoblieMsg(data) {
  return http.get('/auction-user/api/getALiMsg', {mobile:data})
}

export function updateUserPic(data) {
  return http.post('/auction-user/api/updatePic', data)
}

export function updatePassword(data) {
  return http.post('/auction-user/api/updatePwd', data)
}

export function updateUserMobile(data) {
  return http.post('/auction-user/api/updateMobile', data)
}

export function updateUserName(data) {
  return http.post('/auction-user/api/updateName', data)
}

export function updateUserGender(data) {
  return http.post('/auction-user/api/updateSex', data)
}

export function getAddressList(user_id) {
  return http.get('/auction-user/api/getUserAddrbByUserId', {user_id})
}

export function saveAddress(data) {
  return http.post('/auction-user/api/addUserAddr', data)
}

export function deleteAddress(addr_id) {
  return http.delete('/auction-user/api/deleteUserAddr', addr_id)
}

export function setDefaultAddress(data) {
  return http.post('/auction-user/api/updateDefault', {
    newAddr: data.newAddr,
    oldAddr: data.oldAddr
  })
}

export function updateAddress(data) {
  return http.put('/auction-user/api/updateUserAddr', data)
}

